When page is zapped from a domain, the page referenced counter
is checked. But it results in false positive alert on Xen/IA64
because a page 'in use' has reference count 2 on Xen/IA64.
- a page is assigned to guest domain's psudo physical address space.
This is decremented by guest_physmap_remove_page()
- a page is allocated for a domain.
This is decremented by the following put_page()
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
- if ( unlikely((page->count_info & PGC_count_mask) != 1) )
+ if ( unlikely(!page_is_removable(page)) )
{
/* We'll make this a guest-visible error in future, so take heed! */
DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):"
return rc;
}
+static inline int page_is_removable(struct page_info *page)
+{
+ return ((page->count_info & PGC_count_mask) == 2);
+}
+
#define set_machinetophys(_mfn, _pfn) do { } while(0);
#ifdef MEMORY_GUARD
return rc;
}
+static inline int page_is_removable(struct page_info *page)
+{
+ return ((page->count_info & PGC_count_mask) == 1);
+}
+
#define ASSERT_PAGE_IS_TYPE(_p, _t) \
ASSERT(((_p)->u.inuse.type_info & PGT_type_mask) == (_t)); \
ASSERT(((_p)->u.inuse.type_info & PGT_count_mask) != 0)